import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_demo2/material-demo/hello_world/hello_world.dart';

import 'chart_demo/chart_demo.dart';
import 'material-demo/align_example.dart';
import 'material-demo/animated_align.dart';
import 'material-demo/animated_padding_example.dart';
import 'material-demo/app_bar_example.dart';
import 'package:flutter_demo2/material-demo/material_app_example.dart';

import 'material-demo/aspect_ratio_example.dart';
import 'material-demo/clip_rect_example.dart';
import 'material-demo/constrained_box_example.dart';
import 'material-demo/container_example.dart';
import 'material-demo/expansion_panel_demo.dart';
import 'material-demo/fitted_box_example.dart';
import 'material-demo/hamburger_menu.dart';
import 'material-demo/hello_world/cell_content.dart';
import 'material-demo/hello_world/folding_cell.dart';
import 'material-demo/hello_world/folding_cell_list_page.dart';
import 'material-demo/hello_world/folding_demo_page.dart';
import 'material-demo/media_query_example/media_query_example.dart';
import 'material-demo/on_boarding/watch_page.dart';
import 'material-demo/overflow_box_example.dart';
import 'material-demo/padding_example.dart';
import 'material-demo/responsive_demo/app_ui_panel/app_ui_panel.dart';
import 'material-demo/page_view_demo.dart';
import 'material-demo/scaffold_example.dart';
import 'material-demo/size_box_example.dart';
import 'material-demo/sized_overflow_box_example.dart';
import 'material-demo/tab_bar_example.dart';
import 'material-demo/table_demo/table_demo.dart';
import 'my_home_page.dart';
import 'widgets/navigator_text_btn.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        textTheme: const TextTheme(
          headline4: TextStyle(color: Colors.white),
        ),
      ),
      // home: const MyHomePage(title: 'Flutter Demo Home Page'),
      // home: const MaterialAppExample(),
      // home: const ScaffoldExample(),
      // home: const AppBarExample(),
      home: Home(),
      routes: {
        '/Home': (_) => Home(),
        '/HelloWorld': (_) => const HelloWorld(),
        '/FoldingCell': (_) => FoldingCell(onChanged: (FoldingState value) {}),
        '/FoldingDemoPage': (_) => const FoldingDemoPage(),
        '/FoldingCellListPage': (_) => const FoldingCellListPage(),
      },
      initialRoute: '/Home',
    );
  }
}

class Home extends StatelessWidget {
  const Home({
    Key? key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('flutter demo'),
      ),
      body: SingleChildScrollView(
        child: Center(
          child: Column(
            children: [
              NavigatorTextBtn(
                  text: 'Flutter Demo Home Page',
                  widget: MyHomePage(title: 'Flutter Demo Home Page')),
              NavigatorTextBtn(
                  text: 'MaterialAppExample', widget: MaterialAppExample()),
              NavigatorTextBtn(
                  text: 'ScaffoldExample', widget: ScaffoldExample()),
              NavigatorTextBtn(text: 'AppBarExample', widget: AppBarExample()),
              NavigatorTextBtn(text: 'TabBarExample', widget: TabBarExample()),
              NavigatorTextBtn(
                  text: 'PaddingExample', widget: PaddingExample()),
              NavigatorTextBtn(text: 'AlignExample', widget: AlignExample()),
              NavigatorTextBtn(
                  text: 'AnimatedAlignExample', widget: AnimatedAlignExample()),
              NavigatorTextBtn(
                  text: 'ConstrainedBoxExample',
                  widget: ConstrainedBoxExample()),
              NavigatorTextBtn(
                  text: 'SizeBoxExample', widget: SizeBoxExample()),
              NavigatorTextBtn(
                  text: 'FittedBoxExample', widget: FittedBoxExample()),
              NavigatorTextBtn(
                  text: 'OverflowBoxExample', widget: OverflowBoxExample()),
              NavigatorTextBtn(
                  text: 'SizedOverflowBoxExample',
                  widget: SizedOverflowBoxExample()),
              NavigatorTextBtn(
                  text: 'AspectRatioExample', widget: AspectRatioExample()),
              NavigatorTextBtn(
                  text: 'ContainerExample', widget: ContainerExample()),
              NavigatorTextBtn(
                  text: 'AnimatedPaddingExample',
                  widget: AnimatedPaddingExample()),
              NavigatorTextBtn(
                  text: 'ClipRectExample', widget: ClipRectExample()),
              NavigatorTextBtn(text: 'PageViewDemo', widget: PageViewDemo()),
              NavigatorTextBtn(
                  text: 'MediaQueryExample', widget: MediaQueryExample()),
              NavigatorTextBtn(text: 'HamburgerMenu', widget: HamburgerMenu()),
              NavigatorTextBtn(text: 'HelloWorld', widget: HelloWorld()),
              NavigatorTextBtn(text: 'TableDemo', widget: TableDemo()),
              NavigatorTextBtn(
                  text: 'FoldingDemoPage', widget: FoldingDemoPage()),
              NavigatorTextBtn(
                  text: 'FoldingCellListPage', widget: FoldingCellListPage()),
              NavigatorTextBtn(text: 'CellContent', widget: CellContent()),
              ExpansionPanelDemo(
                children: [
                  NavigatorTextBtn(text: 'AppUiPanel', widget: AppUiPanel()),
                ],
              ),
              NavigatorTextBtn(text: 'WatchPage', widget: WatchPage()),
              NavigatorTextBtn(text: 'PageViewDemo', widget: PageViewDemo()),
              NavigatorTextBtn(
                  text: 'ChartDemo',
                  widget: ChartDemo(
                    title: 'ChartDemo',
                  )),
            ],
          ),
        ),
      ),
    );
  }
}
